package com.community.itelligentcommunity.community.communityProperty.controller;

import com.community.itelligentcommunity.common.base.controller.GenericController;
import com.community.itelligentcommunity.common.base.service.GenericService;
import com.community.itelligentcommunity.community.communityProperty.entity.FixedAssetInf;
import com.community.itelligentcommunity.community.communityProperty.entity.QueryFixedAssetInf;
import com.community.itelligentcommunity.community.communityProperty.service.FixedAssetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/fixedAssetControl")
public class FixedAssetControl extends GenericController<FixedAssetInf, QueryFixedAssetInf> {

    @Autowired
    private FixedAssetService fixedAssetService;

    @Override
    protected GenericService<FixedAssetInf, QueryFixedAssetInf> getService() {

        return fixedAssetService;
    }
    @Override
    public String addPage() throws Exception {
        return "community/communityProperty/fixedAssetControl/add";
    }

    @Override
    public String updatePage(FixedAssetInf entity, Model model) throws Exception {
        entity = getService().get(entity);
        model.addAttribute("entity",entity);
        return "community/communityProperty/fixedAssetControl/update";
    }
}
